<template>
	<view>
		<dsl-navbar title="设置" bgTopImg='#FFFFFF' isBack=""></dsl-navbar>
		<view class="rowsb padding bg-white solid-bottom" @click="$tools.push('/pages/plugins/agreement/agreement')">
			<view class="align-center">
				<view class="margin-left-sm">
					用户协议
				</view>
			</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="rowsb padding bg-white solid-bottom" @click="$tools.push('/pages/plugins/agreement/agreement2')">
			<view class="align-center">
				<view class="margin-left-sm">
					隐私协议
				</view>
			</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="rowsb padding bg-white solid-bottom" @click="$tools.push('/pages/plugins/agreement/agreement2')">
			<view class="align-center">
				<view class="margin-left-sm">
					关于我们
				</view>
			</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="rowsb padding bg-white solid-bottom" @click="clearStorageSync">
			<view class="align-center">
				<view class="margin-left-sm">
					清除缓存
				</view>
			</view>
			<view class="cuIcon-right"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isPop: false
			}
		},
		onLoad() {
			this.$tools.setTitle('帮助中心')
		},
		methods: {
			//清除缓存并且退出
			submit() {
				let self = this
				uni.showModal({
					title: '温馨提示',
					content: '确定要退出登录吗？',
					success: function(Res) {
						if (Res.confirm) {
							self.$tools.showToast2('退出成功')
							uni.clearStorageSync() //清除全部缓存
							setTimeout(r => {
								uni.reLaunch({
									url: '../../plugins/login/login'
								})
							}, 1000)
						} else if (Res.cancel) {
							console.log('用户点击取消');
						}
					}
				})

			},
			//清除缓存除了登录状态
			clearStorageSync() {
				this.$tools.showToast('清除缓存成功')
			}
		}
	}
</script>

<style>
	page {
		background: #F2EFEF;
	}

	.submit_tuichu {
		width: 563rpx;
		height: 100rpx;
		background: #ec9948;
		opacity: 1;
		font-size: 36rpx;
		font-family: PingFang SC;
		line-height: 100rpx;
		color: #FFFFFF;
	}
</style>
